1.事件
创建event
php artisan make:event RoomAdded
创建的文件
D:\code\php_laravel\demo1\app\Events\RoomAdded.php
创建监听
php artisan make:listener HandlerNewRoomAdded --event=RoomAdded
添加配置
        'App\Events\RoomAdded' => [
            'App\Listeners\HandlerNewRoomAdded',
        ],

 2.修改文件
 D:\code\php_laravel\demo1\app\Providers\EventServiceProvider.php
 添加事件
        /*注册事件和监听回调*/
        'App\Events\StudentAdded'=>[
            'App\Listeners\HandlerNewStudentAdded',
        ],
 自动生成类和文件
 php artisan event:generate

 3.分发事件
 	$name = "ok";
	event(new App\Events\StudentAdded($name));